package com.github.bridge.client.esign.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
public class BuildTemplateDocRequest {

    @Schema(description = "模板id", requiredMode = Schema.RequiredMode.REQUIRED)
    private String templateId;

    @Schema(description = "文件名称", requiredMode = Schema.RequiredMode.REQUIRED)
    private String fileName;

    @Schema(description = "内容域实例集合", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<TemplateForm> contentsControl;

    @Data
    public static class TemplateForm {

        @Schema(description = "内容域实例id与内容域参数编码必填其一 contentId与contentCode都有值时以contentId为准\n" +
                "contentId与contentCode都没有值返回错误信息：内容域实例id与内容域参数编码必填其一")
        private String contentId;

        @Schema(description = "内容控件id与内容域参数编码必填其一 contentId与contentCode都有值时以contentId为准 contentId与contentCode都没有值返回错误信息：内容域实例id与内容域参数编码必填其一\n" +
                "设置模板内容控件不校验控件长度，不同控件长度内容域编码可相同：pdf在使用该控件时以最小长度为填写校验、word文件控件根据填写长度自适应无需校验长度")
        private String contentCode;

        @Schema(description = "填充内容。请根据【查询模板控件内容】接口返回的控件规则进行填写。", requiredMode = Schema.RequiredMode.REQUIRED)
        private String contentValue;

    }
}
